var image;
Reesenews.views.SubmissionView = Ext
		.extend(
				Ext.form.FormPanel,
				{
					initComponent : function() {

						this.submitButton = new Ext.Button({
							text : 'Submit',
							// ui: 'action',

							handler : this.submitButtonTap,
							scope : this
						});

						this.topToolbar = new Ext.Toolbar({
							title : '<div class="maintitle">Submit</div>',
							items : [ this.submitButton, {
								xtype : 'spacer'
							} ]
						});

						this.dockedItems = [ this.topToolbar ];
						Reesenews.views.SubmissionView.superclass.initComponent
								.call(this);
					},
					submitButtonTap : function() {
						var model = this.getValues(true);
						Ext.Ajax.request({
									url : 'http://10.0.2.2/ReesenewsMailer/mailer/gmail_smtp2.php',
									method : 'GET',
									params : {
										body : model.description,
										name:  model.name,
										email: model.email

									},
									timeout : 3000,
									success : function() {
										alert('Your submission has been sent.');
										Ext.dispatch({
			                                controller: Reesenews.controllers.articleController,
			                                action: 'index'
			                            }); 
									},
									failure : function(xhr, params) {
										alert('Failure!\n' + xhr.responseText);
									}
								});
					},
					backButtonTap : function() {
						Ext.dispatch({
									controller : Reesenews.controllers.articleController,
									action : 'index'
								});
					},

					defaults : {
						labelWidth : '42%',
						useClearIcon : true
					},

					items : [
							{

								xtype : 'textfield',
								name : 'name',
								label : 'Name',
								required : true
							},
							{
								xtype : 'textfield',
								name : 'email',
								label : 'E-Mail',
								required : true
							},
							{
								xtype : 'textareafield',
								name : 'description',
								label : 'Description',
								required : true

							},
						 ],
				});